<?php

/**
 * This is the model metadata class for table "common_district".
 */
class CommonDistrictMetadata extends CARMDC
{
	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'common_district';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('layer, usetype, parent_id, sort', 'numerical', 'integerOnly'=>true),
			array('name', 'length', 'max'=>255),
			array('py', 'length', 'max'=>100),
			array('spy', 'length', 'max'=>20),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, name, layer, usetype, parent_id, sort, py, spy', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'name' => 'Name',
			'layer' => 'Layer',
			'usetype' => 'Usetype',
			'parent_id' => 'Parent',
			'sort' => 'Sort',
			'py' => 'Py',
			'spy' => 'Spy',
		);
	}
}